<h1>Register Publication</h1>

<%= error_messages_for('publication', :message => nil) %>

<div class="show_basic">
  <% form_remote_tag(:url =>fetch_preview_publications_url, 
                     :update => {:success => 'publication_preview', :failure => 'publication_error'}, 
                     :success => "Element.show('publication_preview'); Element.hide('publication_error'); new Effect.Highlight('publication_preview', { duration: 1.0 });",
                     :failure => "Element.show('publication_error'); Element.hide('publication_preview');new Effect.Highlight('publication_error', { duration: 1.0, startcolor: '#FF5555' });", 
                     :loading => "Element.show('spinner')",
                     :complete => "Element.hide('spinner')") do %>
    <p>
      Choose whether to search by PubMed ID or DOI using the dropdown menu below, then enter the document identifier into the text box and click "Fetch".<br/>
      If MethodBox successfully retrieves your publication, click "Register" to process to the next step.
    </p>
    <div id="publication_error" class="error_div" style="display:none"></div>  
    <p>
      <%= select_tag("document_protocol", options_for_select([["PubMed ID","pubmed"],["DOI","doi"]])) %>
      <%= text_field_tag("key") %>
      <%= submit_tag 'Fetch' %>
      <%= image_tag "ajax-loader.gif", :id => 'spinner', :style => 'display:none;' -%>
    </p>    
  <% end %>
  <div id="publication_preview" class="list_item" style="display:none"></div>
</div>